package com.sakura.taos.tool.manipulator.dao;

import com.sakura.taos.tool.manipulator.model.DataBase;
import com.sakura.taos.tool.manipulator.model.DataBaseNews;
import com.sakura.taos.tool.manipulator.model.Variables;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 涛思数据系统数据读取
 *
 * @Author: 贺坤
 * @Date: 2021/1/27 15:27
 */
public interface TaosSysDao {
    @Select("SHOW VARIABLES")
    List<Variables> getSysData();

    /**
     * 某些字段无法映射
     * @return
     */
    @Select("SHOW DATABASES")
    @Deprecated
    List<DataBaseNews> getDatabases();

    @Select("SHOW DATABASES")
    List<Map<String,Object>> getDatabasesMap();

    @Delete("DROP DATABASE ${dbName}")
    Integer removeByDbName(String dbName);

    Integer saveDataBase(DataBase dataBase);
}
